package com.soft.controller;

import com.soft.pojo.Emp;
import com.soft.service.OnWorkService;
import com.soft.service.WorkService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author ruoxi
 * @create 2021-12-27 20:20
 */
@WebServlet("/onWork")
public class OnWorkClock extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String eno = req.getParameter("eno");

        OnWorkService onWorkService = new OnWorkService();
        WorkService workService = new WorkService();

        Emp emp = (Emp) workService.findEmpByEno(eno).getData();
        Integer id = emp.getId();
        String eno1 = emp.getEno();
        String ename = emp.getEname();
        emp.setTime(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));

        //上班打卡没写完
    }
}
